# include "CNet.h"


IRouter* NewRouter(){
    BaseRouter* router=(BaseRouter*)malloc(sizeof(BaseRouter));
    router->vtable.BeforeHandle=BaseRouterBeforeHandle;
    router->vtable.Handle=BaseRouterHandle;
    router->vtable.AfterHandle=BaseRouterAfterHandle;
    
    IRouter* iRouter=(IRouter*)router;
    return iRouter;
}

void BaseRouterBeforeHandle(IRequest* self){
    return;
}
void BaseRouterHandle(IRequest* self){
    Result result= HandleRequestCallBack(self);
    if(result.isSuccess){
        printf("请求处理成功\n");
    }
    return;
}
void BaseRouterAfterHandle(IRequest* self){
    return;
}